<a href='https://github.com/angular/angular.js/edit/v1.2.x/src/ng/parse.js?message=docs($parseProvider)%3A%20describe%20your%20change...#L1158' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.2.29/src/ng/parse.js#L1158' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">$parseProvider</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
  <li>
    <a href="api/ng/service/$parse">- $parse</a>
  </li>

    <li>
      - provider in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p><code>$parseProvider</code> can be used for configuring the default behavior of the <a href="api/ng/service/$parse">$parse</a>
 service.</p>

</div>




<div>
  

    

  <h2 id="usage">Usage</h2>
    
      <p><code>$parseProvider();</code></p>


    

    
    
    

  
<h2>Methods</h2>
<ul class="methods">
  <li id="unwrapPromises">
    <h3><p><code>unwrapPromises([value]);</code></p>

</h3>
    <div><p><strong>This feature is deprecated, see deprecation notes below for more info</strong></p>
<p>If set to true (default is false), $parse will unwrap promises automatically when a promise is
found at any part of the expression. In other words, if set to true, the expression will always
result in a non-promise value.</p>
<p>While the promise is unresolved, it&#39;s treated as undefined, but once resolved and fulfilled,
the fulfillment value is used in place of the promise while evaluating the expression.</p>
<p><strong>Deprecation notice</strong></p>
<p>This is a feature that didn&#39;t prove to be wildly useful or popular, primarily because of the
dichotomy between data access in templates (accessed as raw values) and controller code
(accessed as promises).</p>
<p>In most code we ended up resolving promises manually in controllers anyway and thus unifying
the model access there.</p>
<p>Other downsides of automatic promise unwrapping:</p>
<ul>
<li>when building components it&#39;s often desirable to receive the raw promises</li>
<li>adds complexity and slows down expression evaluation</li>
<li>makes expression code pre-generation unattractive due to the amount of code that needs to be
generated</li>
<li>makes IDE auto-completion and tool support hard</li>
</ul>
<p><strong>Warning Logs</strong></p>
<p>If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a
promise (to reduce the noise, each expression is logged only once). To disable this logging use
<code>$parseProvider.logPromiseWarnings(false)</code> api.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        value
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-boolean">boolean</a>
      </td>
      <td>
        <p>New value.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    
    <h4>Returns</h4>
    <table class="variables-matrix return-arguments">
  <tr>
    <td><a href="" class="label type-hint type-hint-boolean">boolean</a><a href="" class="label type-hint type-hint-self">self</a></td>
    <td><p>Returns the current setting when used as getter and self if used as
                        setter.</p>
</td>
  </tr>
</table>
    

  </li>
  
  <li id="logPromiseWarnings">
    <h3><p><code>logPromiseWarnings([value]);</code></p>

</h3>
    <div><p>Controls whether Angular should log a warning on any encounter of a promise in an expression.</p>
<p>The default is set to <code>true</code>.</p>
<p>This setting applies only if <code>$parseProvider.unwrapPromises</code> setting is set to true as well.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        value
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-boolean">boolean</a>
      </td>
      <td>
        <p>New value.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    
    <h4>Returns</h4>
    <table class="variables-matrix return-arguments">
  <tr>
    <td><a href="" class="label type-hint type-hint-boolean">boolean</a><a href="" class="label type-hint type-hint-self">self</a></td>
    <td><p>Returns the current setting when used as getter and self if used as
                        setter.</p>
</td>
  </tr>
</table>
    

  </li>
  </ul>
  
  



  
</div>


